<!-- 
  * @Description:产品服务的搜索框 
  * @Author:lxy 
  * @Date:2023-03-24 10:23  
-->
<template>
  <div class="bioati">
    <el-form
      ref="searchFromRef"
      :model="searchFromData"
      :inline="true"
      class="demo-ruleForm"
    >
      <el-row :gutter="20" type="flex" justify="space-between">
        <el-col :span="8">
          <el-form-item label="发布人：">
            <el-input
              placeholder="请输入"
              v-model="searchFromData.gonggaoPerpore"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="发布时间：">
            <el-date-picker
              value-format="yyyy-MM-dd HH:mm:ss"
              v-model="searchFromData.gonggaoTime"
              type="datetimerange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            />
          </el-form-item>
        </el-col>
        <el-form-item>
          <div style="text-align: right">
            <el-button icon="el-icon-refresh" @click="resetForm"
              >重置</el-button
            >
            <el-button type="primary" icon="el-icon-search" @click="submitFrom"
              >查询</el-button
            >
          </div>
        </el-form-item>
      </el-row>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "searchFrom",
  data() {
    return {
      searchFromData: {
        gonggaoPerpore: "",
        gonggaoTime: null,
      },
    };
  },
  methods: {
    submitFrom() {
      this.$emit("forSubmit", 1);
    },
    getSearchForm() {
      //方便外面主动来获取数据
      return this.searchFromData;
    },
    resetForm() {
      //重置操作
      this.searchFromData.gonggaoPerpore = "";
      this.searchFromData.gonggaoTime = null;
      //接着发送数据 进行网络请求
      this.$emit("forSubmit", 1);
    },
  },
};
</script>

<style scoped lang="less">
.bioati {
  margin: 15px 0px;
  align-items: center;
  height: 40px;
}
:deep(.el-range-editor.el-input__inner) {
  padding: 0px 10px !important;
}
:deep(.el-input__inner) {
  width: 400px;
}
</style>
